package com.qyhl.shop.view;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.qyhl.shop.R;

public class MyIconModel implements PageGridView.ItemModel {
    private String name;

    private Context context;


    private String imageUrl;

    public MyIconModel(String name, Context context, String imageUrl) {
        this.name = name;
        this.context = context;
        this.imageUrl = imageUrl;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }

    @Override
    public String getItemName() {
        return name;
    }

    @Override
    public void setIcon(ImageView imageView) {
        Glide.with(context)
                .load(imageUrl)
                .apply(new RequestOptions().placeholder(R.drawable.cover_normal_default).error(R.drawable.cover_normal_default))
                .into(imageView);
    }

    @Override
    public void setItemView(View itemView) {

    }
}
